<extend name="Common/layout"/>
<block name="head_add">
    <script src="__STATIC__/plugin/uploadify/jquery.uploadify.js"></script>

    <script src="__STATIC__/plugin/yeditor/js/yeditor.js"></script>
    <link rel="stylesheet" href="__STATIC__/plugin/yeditor/css/yeditor.css">

</block>
<block name="body">
    <div class="panel">
        <div class="panel-heading">
            商品管理
        </div>
        <div class="panel-body">
            <ul id="myTab" class="nav nav-tabs">
                <li class="active">
                    <a href="#tab1" data-toggle="tab">
                        查看
                    </a>
                </li>
                <li><a href="#tab2" data-toggle="tab">添加</a></li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade in active" id="tab1">
                    <div class="list-search clearfix">
                        <form action="__SELF__" method="get">
                            <div class="col-xs-4 col-sm-3">
                                <input name="title" type="text" class="form-control" placeholder="名称">
                            </div>
                            <div class="col-xs-4 col-sm-3">
                                <input name='price' type="text" class="form-control" placeholder="价格：26,54">
                            </div>
                            <div class="col-xs-4 col-sm-3">
                                <input name="sales" type="text" class="form-control" placeholder="销量：26,54">
                            </div>
                            <div class="col-xs-4 col-sm-3">
                                <input name="stock" type="text" class="form-control" placeholder="库存：26,54">
                            </div>
                            <div class="col-xs-4 col-sm-3">
                                <select name="status" class="form-control">
                                    <option value="">状态</option>
                                    <option value="0">未上架</option>
                                    <option value="1">出售中</option>
                                    <option value="2">已售罄</option>
                                    <option value="3">违规</option>
                                    <option value="4">回收站</option>
                                </select>
                            </div>

                            <div class="col-xs-4 col-sm-3">
                                <select class="form-control" id="pid" name="category_id">
                                    <option value="">类目</option>
                                    <volist name="categorys" id="category" key="key">
                                        <option value="{$category['id']}" <eq name="info.pid" value="$category['id']">selected=selected</eq> >
                                        <for start="1" end="$category['depth']">
                                            <if condition="($i+1) eq $category['depth']">
                                                ├─
                                                <else/>
                                                │
                                            </if>
                                        </for>
                                        {$category.title}</option>
                                    </volist>
                                </select>
                            </div>

                            <div class="button">
                                <input type="submit" class="btn btn-default" value="搜索" style="line-height: 14px;">
                            </div>
                        </form>
                    </div>
                    <div class="list-head">
                        <table>
                            <colgroup>
                                <col width="2.57%">
                                <col width="7.47%">
                                <col width="26.41%">
                                <col width="120">
                                <col width="15.46%">
                                <col width="11.6%">
                                <col width="11.86%">
                                <col width="11.1%">
                            </colgroup>
                            <thead>
                            <tr>
                                <th></th>
                                <th></th>
                                <th>宝贝名称</th>
                                <th>价格</th>
                                <th><a title="库存" href="javascript:orderByQuantity()">库存</a></th>
                                <th><a title="总销量" href="javascript:orderByBidCount()">总销量</a></th>
                                <th><a title="发布时间" href="javascript:orderByStartsTime()">发布时间</a></th>
                                <th>操作</th>
                            </tr>
                            <tr>
                                <td colspan="8">
                                    <!--<div class="operations">-->
                                        <!--<input class="all-selector" type="checkbox">-->
                                        <!--<label>全选</label>-->
                                        <!--<button>删除</button>-->
                                        <!--<button>下架</button>-->
                                        <!--<button>推荐</button>-->
                                        <!--<button>取消推荐</button>-->
                                    <!--</div>-->

                                </td>
                            </tr>
                            <tr>
                                <td colspan="8">
                                    <div class="operation" style="text-align: right;">

                                    </div>
                                </td>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <table class="table table-hover table-responsive">
                        <tbody>

                        <colgroup>
                            <col width="2%">
                            <col width="10%">
                            <col width="24.45%">
                            <col width="120">
                            <col width="15.46%">
                            <col width="11.6%">
                            <col width="11.86%">
                            <col width="11.1%">
                        </colgroup>
                        <volist name="goodss" id="goods">
                            <tr>
                                <td><input type="checkbox" name="select" name="{$goods.id}"></td>
                                <td class="photo"><img class="item-pic" src="http://{:C('DOMAIN')}{:get_item_imgs($goods['multimage'],1,'path')['path']}"/></td>
                                <td class="desc">
                                    <div>
                                        <p><a href="/index.php/Goods/detail/id/{$goods['id']}" target="_blank" title="点击打开商品详情页">{$goods.title}</a></p>
                                    </div>
                                </td>
                                <td style="text-align:center;">{$goods.price}</td>
                                <td style="text-align:center;">{$goods.stock}</td>
                                <td style="text-align:center;">{$goods.sales}</td>
                                <td style="text-align:center;">{$goods.pubdate|date='Y-m-d h:i:s',###}</td>
                                <td style="text-align:center;">
                                    <a href="{:U('Goods/edit',array('id'=>$goods['id']))}">编辑</a>
                                    <a href="{:U('Goods/copy',array('id'=>$goods['id']))}">复制</a>
                                    <a href="{:U('Goods/delete',array('id'=>$goods['id']))}">删除</a>

                                </td>
                            </tr>
                        </volist>
                        </tbody>
                    </table>
                    <table style="    width: 100%;">
                        <tbody>
                            <tr>
                                <!--<td colspan="8">-->
                                    <!--<div class="operations">-->
                                        <!--<input class="all-selector" type="checkbox">-->
                                        <!--<label>全选</label>-->
                                        <!--<button>删除</button>-->
                                        <!--<button>下架</button>-->
                                        <!--<button>推荐</button>-->
                                        <!--<button>取消推荐</button>-->
                                    <!--</div>-->
                                <!--</td>-->
                            </tr>
                            <tr>
                                <td colspan="8">
                                    <div class="operation" style="text-align: right;">
                                        <div class="pagination pagination-sm">
                                            {$show}
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>

                </div>
                <div class="tab-pane fade" id="tab2">
                    <include file="Goods/form"/>
                </div>
            </div>
        </div>
    </div>
</block>